// 引入pinia
import { defineStore } from 'pinia';
import { searchProduct } from '@/api/productApi.js';
export const useSearchStore = defineStore({
    persist: {
        enabled: false,
    },
    id: 'searchStore',
    // 定义state
    state: () => ({
        searchData: {},
    }),
    // 定义getter
    getters: {
        getSearchData() {
            return this.searchData;
        },
    },
    actions: {
        // 搜索框触发搜索
        /**
         * @description:
         * @param {*} data 字符串或对象
         * @return {*}
         */
        async searchProduct(data) {
            return searchProduct(data);
        },
    },
});
export default useSearchStore;
